-
Notifications
You must be signed in to change notification settings - Fork 301
Migrate verbosity-based info logging to contextual logging #9707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Migrate verbosity-based info logging to contextual logging #9707
Conversation
…d.go into contextual log
… main.go into contextual log
|
Hi @anndono. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: anndono The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/ok-to-test |
|
Please fix the linting issue. You may use the corresponding makefile target to check linting locally. Both for main module and pkg/azclient module (there are two makefiles separatedly). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates logging from the traditional klog.V(n).Infof/Info/InfoS pattern to contextual logging using logger.V(n).Info with structured key-value pairs. The changes also convert some Info logs to Error logs where error details are present, improving logging consistency across the codebase.
Key changes:
- Replaced
klogverbosity-based logging with contextuallogger.V(n).Infothroughout the codebase - Introduced
log.Background().WithName()pattern for logger initialization in functions - Converted formatted string messages to structured key-value logging
- Updated certain Info logs to Error logs where errors are being logged
Reviewed changes
Copilot reviewed 49 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/util/node/node.go | Migrated PatchNodeCIDRs logging to contextual logging |
| pkg/util/controller/node/controller_utils.go | Updated RecordNodeStatusChange logging |
| pkg/provider/subnet/subnet.go | Converted SubnetsClient logging to structured format |
| pkg/provider/storage/*.go | Migrated storage-related logging across multiple files |
| pkg/provider/securitygroup/*.go | Updated security group operation logging |
| pkg/provider/azure_zones.go | Converted zone-related logging to contextual format |
| pkg/provider/azure_vmssflex*.go | Migrated VMSS Flex logging throughout |
| pkg/provider/azure_vmss*.go | Updated VMSS operation logging |
| pkg/provider/azure_standard.go | Converted availability set logging |
| pkg/provider/azure_loadbalancer*.go | Extensive migration of load balancer logging |
| pkg/provider/azure_routes.go | Updated route management logging |
| pkg/provider/azure*.go | Various provider operation logging updates |
| pkg/nodemanager/nodemanager.go | Migrated node manager logging |
| pkg/nodeipam/ipam/*.go | Updated IPAM allocator logging |
| pkg/metrics/azure_metrics.go | Converted metrics logging |
| pkg/credentialprovider/*.go | Updated credential provider logging |
| pkg/azclient/policy/retryaftermin/*.go | Migrated retry policy logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e60fb0a to
d51eec5
Compare
|
/retest |
1 similar comment
|
/retest |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR improves logging consistency by migrating parts of the codebase from mixed plain-text and structural logging to contextual logging.
Changes:
klog.V(n).Infof/klog.V(n).Info/klog.V(n).InfoSwithlogger.V(n).Infofor contextual loggingInfologs toErrorlogs where error details are presentWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: